package com.atguigu.service.impl;

import com.atguigu.dao.OrderDao;
import com.atguigu.domain.Orders;
import com.atguigu.service.OrderService;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderDao orderDao;

    @Override
    public List<Orders> findAll(int page, int size) {
        //参数pageNum 是页码值   参数pageSize 代表是每页显示条数
        List<Orders> orders = orderDao.findAll();
        System.out.println(orders);
        return orders;
    }

    @Override
    public Orders findById(String ordersId) {
        return orderDao.findById(ordersId);
    }
}
